<?php
#[网站开关]
$sysnav = "system";

#[判断权限]
if($_SESSION["admin"]["typer"] != "system")
{
	Error("对不起，您没有权限操作当前功能",$mainlink."?file=index");
}

if($sys_act == "setok")
{
	$status = intval($status);
	$status_arr["content"] = base64_encode(SafeHtml($content));
	$remarks = $remarks ? $remarks : "";
	$status_arr["remarks"] = base64_encode(SafeHtml($remarks));
	$link = $link ? $link : "";
	$status_arr["link"] = SafeHtml($link);
	$status_json = json_encode($status_arr);
	if(!$status)
	{
		$FS->qgDelete("data/site.lock.php");
	}
	else
	{
		$FS->qgWrite($status_json,"data/site.lock.php");
	}
	Error("设置成功...",$mainlink."?file=status&act=list");
}
else
{
	if(file_exists("data/site.lock.php"))
	{
		$status = 1;
		$status_json = $FS->qgRead("data/site.lock.php");
		$status_arr = json_decode($status_json);
		foreach($status_arr AS $key=>$value)
		{
			$status_arr2[$key] = $value;
		}
		$content = base64_decode($status_arr2["content"]);
		$remarks = base64_decode($status_arr2["remarks"]);
		$link = $status_arr2["link"];
	}
	else
	{
		$status = 0;
		$content = "";
		$remarks = "";
		$link = "";
	}
	Foot("status.qg");
}
?>